/**
 * 
 * @class LogGridPanel
 * @extends Ext.grid.GridPanel
 */
LogGridPanel = Ext.extend(Ext.grid.GridPanel,{
	condition: {mastInsId: 0},
	store: null,
	cm: null,
	constructor: function(config){
		Ext.apply(this, config);
		
		this.condition.limit = 25;
		
		this.store = new Ext.data.Store({
			autoLoad: true,
		    baseParams: this.condition,   
			proxy: new Ext.data.HttpProxy({
				method: 'POST',
				url: '/pdm/sheet/getLogOp.htm'
			}),
			reader: new Ext.data.JsonReader({
				totalProperty: 'totalProperty',
				root: 'root',
				id: 'log_id'
			},[
				{name: 'log_id'},
				{name: 'optime'},
				{name: 'operator'},
				{name: 'message'}
			])
		});
		
		this.cm = new Ext.grid.ColumnModel([
	        {
	           header: "操作时间",
	           dataIndex: 'optime',
	           sortable: true,
	           width: 100
	        },{
	           header: "操作人员",
	           dataIndex: 'operator',
	           width: 100
	        },{
	           header: "操作日志",
	           dataIndex: 'message',
	           width: 300
	        }]);
	        	        
		LogGridPanel.superclass.constructor.call(this, {
			enableColumnMove: false,
			enableHdMenu: false,
		    loadMask: {msg: "日志载入中..."},
		    viewConfig: {forceFit: true},
			region: 'center',
			border: true,
			autoHeight: true,
			layout: 'fit',
			split: true,
			stripeRows: true,
			ds: this.store,
			sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
			cm: this.cm,
			trackMouseOver: false
		});
	}
});
